﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using Power.View.Dialog;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Power.ViewModel.Dialog
{
    public class AIDistinguishSettingsViewModel : ViewModelBase
    {
        private AIDistinguishSettings model;
        public AIDistinguishSettingsViewModel(AIDistinguishSettings model)
        {
            this.model = model;
            Close = new RelayCommand(OnClose);
            CloseOK=  new RelayCommand(OnCloseOK);
        }

        private void OnClose()
        {
            this.model.DialogResult = false;
            this.model.Close();
        }
        private void OnCloseOK()
        {
            var ip1 = this.model.ip1.Text;
            var ip2 = this.model.ip2.Text;
            var ip3 = this.model.ip3.Text;
            var ip4 = this.model.ip4.Text;
            var port = this.model.port.Text;
            var interval = this.model.interval.Text;
            var parallel = this.model.parallel.Text;

            this.model.DialogResult = true;
            this.model.Close();
        }
        

        #region 
        public RelayCommand Close { get; private set; }

        public RelayCommand CloseOK { get; private set; }
        #endregion
    }
}
